import { createRouter, createWebHashHistory } from "vue-router";
import Layout from "../layouts/index.vue"
import library from "./module/library"
import system from "./module/system"
import book from "./module/book"
import user from "./module/user"
const routes = [
    {
        path: "/",
        name: "home",
        component: Layout,
        meta: {
            hidden: true
        }
    },
    {
        path: "/login",
        name: "login",
        component: () => import("../views/login/index.vue"),
        meta: {
            hidden: true
        }
    },
    {
        path: "/404",
        name: "404page",
        component: () => import("../views/404.vue"),
        meta: {
            hidden: true
        }
    },
]

export const asyncRouter = [
    library,
    book,
    system,
    user
]

export const empty = [
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        meta: {
            hidden: true
        }
    },
]



const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;